import {createRouter, createWebHashHistory} from "vue-router"

const routers = [
    {
        path: "/",
        name: 'index',
        component: () => import("../components/index.vue")
    },
    {
        path: '/login',
        name: 'login',
        component: () => import("../components/login.vue")
    }, {
        path: '/miIndex',
        name: 'miIndex',
        component: () => import("../components/miIndex.vue")
    }, {
        path: '/otherLogin',
        name: 'otherLogin',
        component: () => import("../components/otherLogin.vue")
    }, {
        path: '/register',
        name: 'register',
        component: () => import("../components/register.vue")
    }, {
        path: "/mobile",
        name: 'mobile',
        component: () => import("../components/mobile.vue"),
        redirect: {name: 'mobileIndex'},
        children: [
            {
                path: 'index',
                name: 'mobileIndex',
                component: () => import("../components/mIndex.vue")
            },
            {
                path: 'goods',
                name: 'goods',
                component: () => import("../components/goods.vue")
            },
            {
                path: 'car',
                name: 'car',
                component: () => import("../components/shopCar.vue")
            },
            {
                path: 'login',
                name: 'mLogin',
                component: () => import("../components/mlogin.vue")
            },
            {
                path: 'register',
                name: 'mRegister',
                component: () => import("../components/mregister.vue")
            },
            {
                path: 'mDetail',
                name: 'mDetail',
                component: () => import("../components/mdetail.vue")
            }
        ]
    }, {
        path: '/detail',
        name: 'detail',
        component: () => import("../components/detailPage.vue")
    },{
        path: '/shopCar',
        name: 'shopCar',
        component: () => import("../components/WShopCar.vue")
    }
]
const router = createRouter({
    history: createWebHashHistory(),
    routes: routers
})
export default router